import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
import { loadMicroApp } from "qiankun";
import { registerApps } from "./qiankun-config";

@Component({
  selector: 'main-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.less']
})
export class AppComponent implements OnInit {
  @ViewChild("angularApp3")
  // @ts-ignore
  containerRef: ElementRef;

  isCollapsed = false;

  ngOnInit(): void {
    // @ts-ignore
    if (!window.qiankunStarted) {
      // @ts-ignore
      window.qiankunStarted = true;
      registerApps();
    }
  }


  loadSub() {
    // loadMicroApp(
    //   {
    //     name: 'angularApp3',
    //     entry: '//localhost:4300',
    //     // @ts-ignore
    //     container: this.containerRef.nativeElement
    //   }
    // )
  }
}
